from CAR import CAR
import time
import RPi.GPIO as GPIO
from detect import decete

if __name__ == "__main__":
    car = CAR()
    try:

        if decete() is True:
            car.go_forward()
            time.sleep(0.8)
            car.go_stop()
            time.sleep(0.8)
            car.go_back()
            time.sleep(0.8)
            car.go_stop()
            time.sleep(0.8)
        else:
            pass

    except KeyboardInterrupt:
        car.go_stop()                               
